using Microsoft.AspNetCore.SignalR;

namespace WebCoreAPI.SignalR
{
    public class MyHub : Hub
    {
        public Task SendPublicMessage(string message)
        {
            string connId = this.Context.ConnectionId; // 拿到连接到该服务的Id；
            string sendmssg = $"{connId}#{DateTime.Now}:{message}";
            return Clients.All.SendAsync("ReceivePublicMessage" + sendmssg);
        }

    }
}
